import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YCKOKO
 * Date: 2022-11-08
 * Time: 16:09
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("头插法插入元素：");
        MySingleList mySingleList = new MySingleList();
        mySingleList.addFirst(1);
        mySingleList.addFirst(2);
        mySingleList.addFirst(3);
        mySingleList.addFirst(4);
        mySingleList.addFirst(5);
        mySingleList.addFirst(6);
        mySingleList.display();
        System.out.println("===========");
        System.out.println("尾插法插入元素：");
        MySingleList mySingleList1 = new MySingleList();
        mySingleList1.addLast(1);
        mySingleList1.addLast(2);
        mySingleList1.addLast(3);
        mySingleList1.addLast(4);
        mySingleList1.addLast(5);
        mySingleList1.addLast(6);
        mySingleList1.display();
        System.out.println("===========");
        System.out.println("指定位置插入检测：");
        mySingleList1.addIndex(4,8);
        mySingleList1.display();
        System.out.println("===========");
        mySingleList1.addIndex(0,8);
        mySingleList1.display();
        System.out.println("===========");
        mySingleList1.addIndex(7,8);
        mySingleList1.display();
        System.out.println("===========");
        mySingleList1.addIndex(10,8);
        mySingleList1.display();
        System.out.println("===========");
        System.out.println("检测是否包含元素：");
        System.out.println(mySingleList1.contains(8));
        System.out.println(mySingleList1.contains(10));
        System.out.println("===========");
        System.out.println("删除第一个key检测：");
        mySingleList1.remove(6);
        mySingleList1.display();
        mySingleList1.remove(10);
        mySingleList1.display();
        System.out.println("===========");
        System.out.println("删除全部key值检测：");
        mySingleList1.removeAllKey(8);
        mySingleList1.display();
        System.out.println("===========");
        System.out.println("清空链表元素检测：");
        mySingleList1.clear();
        mySingleList1.display();
        System.out.println("===========");
    }
}
